<?php
function ERR(){
    
	
	echo "出错了";
}
mkdir("demo",0777);
mkdir("demo/images",0777);

$str=  file_get_contents("http://www.baidu.com");


if(preg_match("/utf-8/",$str))
{
	header("content-Type: text/html; charset=Utf-8"); 	
}



if(preg_match("/utf-8/",$str))
{
	header("content-Type: text/html; charset=Utf-8"); 	
}




file_put_contents('demo/result.html', $str);



?>
<script>alert('<?=$str ?>');</script>